package com.socket.websocket;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/message/chatmsg")
public class ChatmsgApi {

	@RequestMapping(value = { "", "/", "/index" }, produces = { MediaType.APPLICATION_JSON_VALUE,
			MediaType.APPLICATION_JSON_UTF8_VALUE })
	public String index(HttpServletRequest req, HttpServletResponse res) {

		try {
			WebSocketServer.sendInfo("测试数据", "2");
		} catch (IOException e) {
			e.printStackTrace();
		}
		return "";
	}

}
